home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / dev / basic / hsb_reqt_inc.lha / hsb_reqt_inc / bh / reqtools.bh < prev   
Text File  |  1997-04-21  |  85KB  |  1,805 lines

  1. '  Reqtools Basic Header and Doc
  2. '  based an the C-Includes
  3. REM $UNDERLINES
  4. REM $INCLUDE reqtools.bc
  5. LIBRARY DECLARE "reqtools.library"
  6. '
  7. DECLARE FUNCTION rtAllocRequestA& LIBRARY
  8. '
  9. '    req = rtAllocRequestA (type, taglist);
  10. '
  11. '    APTR rtAllocRequestA (ULONG, struct TagItem *);
  12. '    D0                    D0     A0
  13. '
  14. '
  15. '  DESCRIPTION
  16. '    Allocates a requester structure for you in a future compatible manner.
  17. '    This is the only way to properly allocate a rtFileRequester,
  18. '    rtFontRequester, rtReqInfo or rtScreenModeRequester structure.  The
  19. '    structure will be initialized for you.
  20. '
  21. '    Use rtFreeRequest() to free the requester structure when you no longer
  22. '    need it.
  23. '
  24. '  INPUTS
  25. '    type    - type of structure to allocate, currently RT_REQINFO,
  26. '              RT_FILEREQ, RT_FONTREQ or RT_SCREENMODEREQ.
  27. '    taglist - pointer to array of tags (currently always NULL).
  28. '
  29. '  TAGS
  30. '    no tags defined yet
  31. '
  32. '  RESULT
  33. '    req - pointer to the requester allocated or NULL if no memory.
  34. '
  35. '  BUGS
  36. '    none known
  37. '
  38. '  SEE ALSO
  39. '    rtFreeRequest()
  40. '
  41. '
  42. DECLARE FUNCTION  rtChangeReqAttrA& LIBRARY
  43. '
  44. '    [long =] rtChangeReqAttrA (req, taglist);
  45. '
  46. '    [LONG] rtChangeReqAttrA (APTR, struct TagItem *);
  47. '                      A1    A0
  48. '
  49. '  DESCRIPTION
  50. '    Change requester attributes with supplied taglist.  This is the only
  51. '    correct way to change the attributes listed below.
  52. '
  53. '    The return code from rtChangeReqAttrA() should be ignored unless stated
  54. '    otherwise.
  55. '
  56. '    Don't pass the tags listed below to the requester itself (unless
  57. '    documented otherwise).  They will not be recognized.
  58. '
  59. '  INPUTS
  60. '    req     - pointer to requester.
  61. '    taglist - pointer to array of tags.
  62. '
  63. '  TAGS
  64. '    for the file requester:
  65. '        RTFI_Dir         - (char *)
  66. '                           Name of new directory to position file requester
  67. '                           in. The requester's buffer will be deallocated.
  68. '        RTFI_MatchPat    - (char *)
  69. '                           New pattern string to match files on.
  70. '        RTFI_AddEntry    - (BPTR)
  71. '                           THIS *MUST* BE THE LAST TAG (just before TAG_END)!
  72. '                           Tagdata must hold a lock on a file or directory
  73. '                           you want to add to the file requester's buffer.
  74. '                           The lock should have been obtained using Lock(),
  75. '                           and you must unlock this lock yourself.
  76. '                           It is your responsibility to make sure the file
  77. '                           or directory is indeed in the directory the file
  78. '                           requester is in.
  79. '                           If the entry is already in the file requester's
  80. '                           buffer it will simply be updated.
  81. '                           It is harmless to use this tag if the requester's
  82. '                           buffer is not initialized. rtChangeReqAttr() will
  83. '                           return a boolean to indicate success or failure
  84. '                           (out of memory).
  85. '        RTFI_RemoveEntry - (char *)
  86. '                           Name of file or directory you want to remove from
  87. '                           the file requester's buffer.
  88. '                           It is your responsibility to make sure the file
  89. '                           or directory is indeed in the directory the file
  90. '                           requester is in.
  91. '                           It is harmless use this tag if the requester's
  92. '                           buffer is not initialized.
  93. '    for the font requester:
  94. '        RTFO_FontName    - (char *) 
  95. '                           Set the name of the currently selected font.
  96. '        RTFO_FontHeight  - (UWORD)
  97. '                           Set the fontsize of the currently selected font.
  98. '        RTFO_FontStyle   - (UBYTE)
  99. '                           Set the style of the current font.
  100. '        RTFO_FontFlags   - (UBYTE)
  101. '                           Set the flags of the current font.
  102. '    for the screenmode requester [V38]:
  103. '        RTSC_ModeFromScreen - (struct Screen *)
  104. '                              Screen to get mode attributes from.
  105. '                              NOTE: You must make sure the mode this screen
  106. '                                    is in will be accepted by the screen
  107. '                                    mode requester.  Otherwise it will auto-
  108. '                                    matically cancel.  For example, you use
  109. '                                    RTDI_ModeFromScreen on a HAM screen and
  110. '                                    you haven't set the SCREQF_NONSTDMODES
  111. '                                    flag.
  112. '        RTSC_DisplayID      - (ULONG)
  113. '                              Set 32-bit mode id of selected mode.  The width
  114. '                              and height will be set to the default (visible)
  115. '                              width and height, and the depth will be set to
  116. '                              maximum.  Also read note above.  Note that you
  117. '                              must use this tag _before_ the three tags below
  118. '                              because this tag will set the width, height and
  119. '                              depth to default values.
  120. '        RTSC_DisplayWidth   - (UWORD)
  121. '                              Set width of display.  Must come after
  122. '                              RTSC_DisplayID or RTSC_ModeFromScreen tags.
  123. '        RTSC_DisplayHeight  - (UWORD)
  124. '                              Set height of display.  Must come after
  125. '                              RTSC_DisplayID or RTSC_ModeFromScreen tags.
  126. '        RTSC_DisplayDepth   - (UWORD)
  127. '                              Set depth of display.  Must come after
  128. '                              RTSC_DisplayID or RTSC_ModeFromScreen tags.
  129. '        RTSC_OverscanType   - (ULONG)
  130. '                              Set type of overscan.  Set to 0 for regular
  131. '                              size, otherwise use OSCAN_... constants.
  132. '                              See 'intuition/screens.[h|i]'.
  133. '        RTSC_AutoScroll     - (BOOL)
  134. '                              Boolean state of autoscroll checkbox.
  135. '
  136. '  RESULT
  137. '    none (except when RTFI_AddEntry tag is used, see above)
  138. '
  139. '  BUGS
  140. '    none known
  141. '
  142. '  SEE ALSO
  143. '    dos.library/Lock()
  144. '
  145. '
  146. DECLARE SUB rtCloseWindowSafely LIBRARY
  147. '
  148. '    rtCloseWindowSafely (window);
  149. '
  150. '    void rtCloseWindowSafely (struct Window *);
  151. '                              A0
  152. '
  153. '  DESCRIPTION
  154. '    Closes a window which shares its IDCMP port with another window.  All the
  155. '    pending messages (concerning this window) on the port will be removed and
  156. '    the window will be closed.
  157. '
  158. '    Do not use this function to close windows which have an IDCMP port set up
  159. '    by Intuition.  If you do the port will be left in memory!
  160. '
  161. '    If you intend to open a lot of windows all sharing the same IDCMP port it
  162. '    is easiest if you create a port yourself and open all windows with
  163. '    newwin.IDCMPFlags set to 0 (this tells Intuition to NOT set up an IDCMP
  164. '    port).  After opening the window set the win->UserPort to your message
  165. '    port and call ModifyIDCMP to set your IDCMP flags.
  166. '
  167. '    When you then receive messages from intuition check the imsg->IDCMPWindow
  168. '    field to find out what window they came from and act upon them.
  169. '
  170. '    When closing your windows call rtCloseWindowSafely() for all of them and
  171. '    delete your message port.  Easy peasy :-)
  172. '
  173. '    NOTE: Only call rtCloseWindowSafely() for windows with a shared IDCMP
  174. '          port.  Do *NOT* call it for windows with an IDCMP port created
  175. '          by Intuition!
  176. '
  177. '  INPUTS
  178. '    window - pointer to the window to be closed.
  179. '
  180. '  RESULT
  181. '    none
  182. '
  183. '  NOTE
  184. '    This function is for the advanced ReqTools user.
  185. '
  186. '  BUGS
  187. '    none known
  188. '
  189. '  SEE ALSO
  190. '    intuition.library/CloseWindow()
  191. '
  192. '
  193. DECLARE FUNCTION rtEZRequestA& LIBRARY
  194. '
  195. '    ret = rtEZRequestA (bodyfmt, gadfmt, reqinfo, argarray, taglist);
  196. '
  197. '    ULONG rtEZRequestA
  198. '                (char *, char *, struct rtReqInfo *, APTR, struct TagItem *);
  199. '    D0           A1      A2      A3                  A4    A0
  200. '
  201. '  DESCRIPTION
  202. '    This function puts up a requester for you and waits for a response from
  203. '    the user. If the response is positive, this procedure returns TRUE.
  204. '    If the response is negative, this procedure returns FALSE.
  205. '    The function may also return an IDCMP flag or a value corresponding with
  206. '    one of other possible responses (see below).
  207. '
  208. '    'gadfmt' may contain several possible responses.  Separate these
  209. '    responses by a '|'.  For example: "Yes|No", or 'Yes|Maybe|No".  The
  210. '    responses should be typed in the same order as they will appear on
  211. '    screen, from left to right.  There is no limit to the number of responses
  212. '    other than the width of the screen the requester will appear on.
  213. '
  214. '    'bodyfmt' can contain newlines ('\n', ASCII 10). This will cause a new
  215. '    line to be started (surprise, surprise :-).
  216. '    You may also include 'printf' style formatting codes. The format
  217. '    arguments should be pointed to by 'argarray'.
  218. '    You can use formatting codes in 'gadfmt' as well.  The arguments for
  219. '    this format string should follow the ones for 'bodyfmt'.
  220. '
  221. '    NOTE: The formatting is done by exec.library/RawDoFmt(), so be aware that
  222. '          to display a 32-bit integer argument you must use "%ld", not "%d",
  223. '          since RawDoFmt() is "word-oriented."
  224. '
  225. '    The second and third function use a variable number of arguments. These
  226. '    functions can be found in 'reqtools[nb].lib'.
  227. '    The second function has the RawDoFmt arguments as variable args, the
  228. '    third the tags. If you need both this is what you can do:
  229. '
  230. '    ...
  231. '       {
  232. '       ULONG tags[] = { RTEZ_ReqTitle, (ULONG)"mytitle", TAG_END };
  233. '
  234. '       rtEZRequest ("String, num: %s, %ld", NULL, "Ok",
  235. '                                           (struct TagItem *)tags, "six", 6);
  236. '       }
  237. '    ...
  238. '
  239. '    You can satisfy the requester with the following keyboard shortcuts:
  240. '      'Y' or Left Amiga 'V' for a positive response,
  241. '      ESC, 'N', 'R' or Left Amiga 'B' for a negative response.
  242. '
  243. '    If EZREQF_NORETURNKEY is _not_ set (see RTEZ_Flags below) the RETURN key
  244. '    is also accepted as a shortcut for the positive response (can be changed
  245. '    using RTEZ_DefaultResponse, see below).  The response that will be
  246. '    selected when you press RETURN will be printed in bold.
  247. '
  248. '    The EZREQF_LAMIGAQUAL flag should be used when you put up a requester
  249. '    for a destructive action (e.g. to delete something).  When it is set
  250. '    the keyboard shortcuts are limited to Left Amiga 'V' and 'B' so it is
  251. '    harder to accidently select something you will regret.
  252. '    Note that the RETURN and ESC key remain active!  To disable the RETURN
  253. '    key use the EZREQF_NORETURNKEY flag.  The ESC key cannot be disabled.
  254. '
  255. '    You may pass a NULL for 'gadfmt', but make sure you know what you are
  256. '    doing.  Passing a NULL opens an EZRequester with NO responses, just a
  257. '    body text.  This implies the user has no means of "answering" this
  258. '    requester.  You must therefore use the RT_IDCMPFlags tag to allow some
  259. '    other events to end the requester (e.g. IDCMP_MOUSEBUTTONS,
  260. '    IDCMP_INACTIVEWINDOW,...) or you must make use of the ReqHandler feature.
  261. '    Using a requester handler you can end the requester by program control.
  262. '    This way you can e.g. put up a requester before you start loading a file
  263. '    and remove it after the file has been loaded.  Do not pass an empty
  264. '    string as 'gadfmt'!
  265. '
  266. '    'reqinfo' can be used to customize the requester.  For greater control
  267. '    use the tags listed below.  The advantage of the rtReqInfo structure is
  268. '    that it is global, where tags have to be specified each function call.
  269. '    See libraries/reqtools.[hi] for a description of the rtReqInfo structure.
  270. '
  271. '  INPUTS
  272. '    bodyfmt  - requester body text, can be format string a la RawDoFmt().
  273. '    gadfmt   - text for gadgets (left to right, separated by '|') or NULL.
  274. '    argarray - pointer to array of arguments for format string(s).
  275. '    reqinfo  - pointer to a rtReqInfo structure allocated with
  276. '               rtAllocRequest() or NULL.
  277. '    taglist  - pointer to a TagItem array.
  278. '
  279. '  TAGS
  280. '    RT_Window       - (struct Window *)
  281. '                      Window that will be used to find the screen to put the
  282. '                      requester on.
  283. '                      You *MUST* supply this if you are a task calling this
  284. '                      function and not a process! This is because tasks
  285. '                      don't have a pr_WindowPtr.
  286. '    RT_IDCMPFlags   - (ULONG)
  287. '                      Extra idcmp flags to return on.  If one these IDCMP
  288. '                      flags causes the requester to abort the return code
  289. '                      will equal the flag in question.
  290. '    RT_ReqPos       - (ULONG)
  291. '                      One of the following:
  292. '                        REQPOS_POINTER    - requester appears where the mouse
  293. '                                            pointer is (default).
  294. '                        REQPOS_CENTERSCR  - requester is centered on the
  295. '                                            screen.
  296. '                        REQPOS_CENTERWIN  - requester is centered in the
  297. '                                            window (only works if the
  298. '                                            pr_WindowPtr of your process is
  299. '                                            valid or if you use RT_Window).
  300. '                                            If RT_Window is NULL the
  301. '                                            requester will be centered on
  302. '                                            the screen.
  303. '                        REQPOS_TOPLEFTSCR - requester appears at the top left
  304. '                                            of the screen.
  305. '                        REQPOS_TOPLEFTWIN - requester appears at the top left
  306. '                                            of the window (only works if the
  307. '                                            pr_WindowPtr of your process is
  308. '                                            valid or if you use RT_Window).
  309. '                      The requester will always remain in the visible part of
  310. '                      the screen, so if you use the Workbench 2.0 ScreenMode
  311. '                      preferences editor to enlarge your Workbench screen and
  312. '                      you scroll around, the requester will always appear in
  313. '                      the part you can see.
  314. '                      REQPOS_CENTERSCR and REQPOS_TOPLEFTSCR also apply to
  315. '                      the visible part of the screen. So if you use one of
  316. '                      these the requester will be appear in the center or the
  317. '                      top left off what you can see of the screen as opposed
  318. '                      to the entire screen.
  319. '                      REQPOS_CENTERWIN and REQPOS_TOPLEFTWIN fall back to
  320. '                      REQPOS_CENTERSCR or REQPOS_TOPLEFTSCR respectively
  321. '                      when there is no parent window.  So you can safely use
  322. '                      these without worrying about the existence of a window.
  323. '    RT_LeftOffset   - (ULONG)
  324. '                      Offset of left edge of requester relative to position
  325. '                      specified with RT_ReqPos (does not offset the requester
  326. '                      when RT_ReqPos is REQPOS_POINTER).
  327. '    RT_TopOffset    - (ULONG)
  328. '                      Offset of top edge of requester relative to position
  329. '                      specified with RT_ReqPos (does not offset the requester
  330. '                      when RT_ReqPos is REQPOS_POINTER).
  331. '    RT_PubScrName   - (char *)
  332. '                      Name of public screen requester should appear on. When
  333. '                      this tag is used the RT_Window tag will be ignored.
  334. '                      If the public screen is not found the requester will
  335. '                      open on the default public screen.
  336. '                      Only works on Kickstart 2.0!  reqtools.library does
  337. '                      not check this, it is up to you *NOT* to use this tag
  338. '                      on Kickstart 1.3 or below!
  339. '                      Note that the 1.3 version of reqtools.library also
  340. '                      understands and supports this tag (on 2.0).
  341. '    RT_Screen       - (struct Screen *)
  342. '                      Address of screen to put requester on.  You should
  343. '                      never use this, use RT_Window or RT_PubScrName.
  344. '    RT_ReqHandler   - (struct rtHandlerInfo **)
  345. '                      Using this tag you can start an "asynchronous"
  346. '                      requester. ti_TagData of the tag must hold the address
  347. '                      of a pointer variable to a rtHandlerInfo structure.
  348. '                      The requester will initialize this pointer and will
  349. '                      return immediately after its normal initialization.
  350. '                      The return code will not be what you would normally
  351. '                      expect.  If the return code is _not_ equal to
  352. '                      CALL_HANDLER an error occurred and you should take
  353. '                      appropriate steps. If the return code was CALL_HANDLER
  354. '                      everything went ok and the requester will still be up!
  355. '                      See the explanation for rtReqHandlerA() below for the
  356. '                      following steps you have to take.
  357. '    RT_WaitPointer  - (BOOL)
  358. '                      If this is TRUE the window calling the requester will
  359. '                      get a standard wait pointer set while the requester is
  360. '                      up.  This will happen if you used the RT_Window tag or
  361. '                      if your process's pr_WindowPtr is valid.  Note that
  362. '                      after the requester has finished your window will be
  363. '                      ClearPointer()-ed.  If you used a custom pointer in
  364. '                      your window you will have to re-set it, or not use the
  365. '                      RT_WaitPointer tag and put up a wait pointer yourself.
  366. '                      If your program requires ReqTools V38 it is advised you
  367. '                      use RT_LockWindow instead.  Defaults to FALSE.
  368. '    RT_LockWindow   - (BOOL) [V38]
  369. '                      If this is TRUE the window calling the requester will
  370. '                      get locked.  It will no longer accept any user input
  371. '                      and it will get standard wait pointer set.  This will
  372. '                      happen only if you used the RT_Window tag or if your
  373. '                      process's pr_WindowPtr is valid.  RT_LockWindow will
  374. '                      restore a custom pointer if you have used one (unlike
  375. '                      RT_WaitPointer).  So you do not have to worry about
  376. '                      having to restore it yourself.  It is advised you use
  377. '                      this tag as much as possible. Defaults to FALSE.
  378. '                      Under Kickstart V39 the original window pointer will
  379. '                      not be restored if it was set using SetWindowPointer().
  380. '                      You will have to restore the pointer yourself in this
  381. '                      case.
  382. '    RT_ScreenToFront - (BOOL) [V38]
  383. '                      Boolean indicating whether to pop the screen the
  384. '                      requester will appear on to the front. Default is TRUE.
  385. '    RT_ShareIDCMP   - (BOOL) [V38]
  386. '                      Boolean indicating whether to share the IDCMP port of
  387. '                      the parent window. Use this tag together with the
  388. '                      RT_Window tag to indicate the window to share IDCMP
  389. '                      with. Sharing the IDCMP port produces less overhead,
  390. '                      so it is advised you use this tag. Defaults to FALSE.
  391. '    RT_Locale       - (struct Locale *) [V38]
  392. '                      Locale to determine what language to use for the
  393. '                      requester text.  If this tag is not used or its data
  394. '                      is NULL, the system's current default locale will be
  395. '                      used. Default NULL.
  396. '    RT_IntuiMsgFunc - (struct Hook *) [V38]
  397. '                      The requester will call this hook for each IDCMP
  398. '                      message it gets that doesn't belong to its window.
  399. '                      Only applies if you used the RT_ShareIDCMP tag to share
  400. '                      the IDCMP port with the parent window.  Parameters are
  401. '                      as follows:
  402. '                        A0 - (struct Hook *) your hook
  403. '                        A2 - (struct rtReqInfo *) your requester info
  404. '                        A1 - (struct IntuiMessage *) the message
  405. '                      After you have finished examining the message and your
  406. '                      hook returns, ReqTools will reply the message.  So do
  407. '                      not reply the message yourself!
  408. '    RT_Underscore   - (char) [V38]
  409. '                      Indicates the symbol that precedes the character in the
  410. '                      gadget label to be underscored.  This is to define a
  411. '                      keyboard shortcut for this gadget.  Example: to define
  412. '                      the key 'Q' as a keyboard shortcut for "Quit" and 'N'
  413. '                      for "Oh, No!" you would use the tag RT_Underscore, '_'
  414. '                      and pass as gadfmt "_Quit|Oh, _No!".  Do not use the
  415. '                      symbol '%' as it is used for string formatting.  The
  416. '                      usual character to use is '_' like in the example.
  417. '                      IMPORTANT: the shortcuts defined using RT_Underscore
  418. '                      take precedence of the default shortcuts!  It is for
  419. '                      example not wise to use a 'N' for a positive response!
  420. '                      Pick your shortcuts carefully!
  421. '    RT_TextAttr     - (struct TextAttr *) [V38]
  422. '                      Use this font for the requester.  Default is to use the
  423. '                      screen font.  Note that the font must already be
  424. '                      opened by you.  ReqTools will call OpenFont() on this
  425. '                      TextAttr, _not_ OpenDiskFont()!  If the font cannot be
  426. '                      opened using OpenFont() the default screen font will
  427. '                      be used.
  428. '    RTEZ_ReqTitle   - (char *)
  429. '                      Title of requester window, default is "Request" unless
  430. '                      the requester has less than 2 responses, then the
  431. '                      default title is "Information".
  432. '    RTEZ_Flags      - (ULONG)
  433. '                      Flags for rtEZRequestA():
  434. '                        EZREQF_NORETURNKEY - turn off the RETURN key as
  435. '                                             shortcut for positive response.
  436. '                        EZREQF_LAMIGAQUAL  - keyboard shortcuts are limited
  437. '                                             to Left Amiga 'V' and 'B', ESC
  438. '                                             and RETURN.
  439. '                        EZREQF_CENTERTEXT  - centers each line of body text
  440. '                                             in the requester window. Useful
  441. '                                             for about requesters.
  442. '    RTEZ_DefaultResponse - (ULONG)
  443. '                      Response value that will be returned when the user
  444. '                      presses the return key.  Will be ignored if the
  445. '                      EZREQF_NORETURNKEY flag is set.  The text for this
  446. '                      response will be printed in bold. Default is 1.
  447. '
  448. '  RESULT
  449. '    ret - 1 (TRUE) for leftmost (positive) response, then each consecutive
  450. '          response will return 1 more, the rightmost (false) response will
  451. '          return 0 (FALSE), so 1,2,3,...,num-1,0 -- or idcmp flag.
  452. '
  453. '  NOTE
  454. '    Automatically adjusts the requester to the screen font.
  455. '
  456. '    rtEZRequestA() checks the pr_WindowPtr of your process to find the
  457. '    screen to put the requester on.
  458. '
  459. '  BUGS
  460. '    none known
  461. '
  462. '  SEE ALSO
  463. '    exec.library/RawDoFmt(), rtReqHandlerA()
  464. '
  465. '
  466. DECLARE FUNCTION rtFileRequestA& LIBRARY
  467. '
  468. '    ret = rtFileRequestA (filereq, filename, title, taglist);
  469. '
  470. '    APTR rtFileRequestA
  471. '                (struct rtFileRequester *, char *, char *, struct TagItem *);
  472. '    D0           A1                        A2      A3      A0
  473. '
  474. '  DESCRIPTION
  475. '    Get a directory and filename(s), or just a directory from the user.
  476. '
  477. '    'filename' should point to an array of at least 108 chars.  The filename
  478. '    already in 'filename' will be displayed in the requester when it comes
  479. '    up.  When the requester returns 'filename' will probably have changed.
  480. '
  481. '    Using certain tags may result in the calling of a caller-supplied hook.
  482. '
  483. '    The hook will be called with A0 holding the address of your hook
  484. '    structure (you may use the h_Data field to your own liking), A2 a pointer
  485. '    to the requester structure calling the hook ('req') and A1 a pointer to
  486. '    an object.  The object is variable and depends on what your hook is for.
  487. '
  488. '    This is an example of a hook suitable to be used with the RTFI_FilterFunc
  489. '    tag:
  490. '
  491. '    SAS/C users can define their function thus:
  492. '
  493. '    BOOL __asm __saveds filterfunc (register __a0 struct Hook *filterhook,
  494. '       register __a2 struct rtFileRequester *req,
  495. '       register __a1 struct FileInfoBlock *fib)
  496. '    {
  497. '       BOOL accepted = TRUE;
  498. '
  499. '       /* examine fib to decide if you want this file in the requester */
  500. '       ...
  501. '       return (accepted);
  502. '    }
  503. '
  504. '    Your hook structure should then be initialized like this:
  505. '
  506. '       filterhook->h_Entry = filterfunc;
  507. '       /* in this case no need to initialize hook->h_SubEntry */
  508. '       filterhook->h_Data = your_userdata_if_needed;
  509. '
  510. '    You can also use a stub written in machine code to call
  511. '    your function. (see 'utility/hooks.h')
  512. '
  513. '  INPUTS
  514. '    filereq  - pointer to a struct rtFileRequester allocated with
  515. '               rtAllocRequestA().
  516. '    filename - pointer to an array of chars (must be 108 bytes big).
  517. '    title    - pointer to requester window title (null terminated).
  518. '    taglist  - pointer to a TagItem array.
  519. '
  520. '  TAGS
  521. '    RT_Window          - see rtEZRequestA()
  522. '    RT_ReqPos          - see rtEZRequestA()
  523. '    RT_LeftOffset      - see rtEZRequestA()
  524. '    RT_TopOffset       - see rtEZRequestA()
  525. '    RT_PubScrName      - see rtEZRequestA()
  526. '    RT_Screen          - see rtEZRequestA()
  527. '    RT_ReqHandler      - see rtEZRequestA()
  528. '    RT_WaitPointer     - see rtEZRequestA()
  529. '    RT_LockWindow      - [V38] see rtEZRequestA()
  530. '    RT_ScreenToFront   - [V38] see rtEZRequestA()
  531. '    RT_ShareIDCMP      - [V38] see rtEZRequestA()
  532. '    RT_Locale          - [V38] see rtEZRequestA()
  533. '    RT_IntuiMsgFunc    - (struct Hook *) [V38]
  534. '                         The requester will call this hook for each IDCMP
  535. '                         message it gets that doesn't belong to its window.
  536. '                         Only applies if you used the RT_ShareIDCMP tag to
  537. '                         share the IDCMP port with the parent window.
  538. '                         Parameters are as follows:
  539. '                           A0 - (struct Hook *) your hook
  540. '                           A2 - (struct rtFileRequester *) your requester
  541. '                           A1 - (struct IntuiMessage *) the message
  542. '                         After you have finished examining the message and
  543. '                         your hook returns, ReqTools will reply the message.
  544. '                         So do not reply the message yourself!
  545. '    RT_Underscore      - (char) [V38]
  546. '                         Indicates the symbol that precedes the character in
  547. '                         a gadget's label to be underscored.  This will also
  548. '                         define the keyboard shortcut for this gadget.
  549. '                         Currently only needed for RTFI_OkText.  Usually set
  550. '                         to '_'.
  551. '    RT_DefaultFont     - (struct TextFont *)
  552. '                         This tag allows you to specify the font to be used
  553. '                         in the requester when the screen font is
  554. '                         proportional. Default is GfxBase->DefaultFont.
  555. '    RT_TextAttr        - (struct TextAttr *) [V38]
  556. '                         Use this font for the requester.  Must be a fixed
  557. '                         width font, _not_ a proportional one.  Default is to
  558. '                         use the screen font or the default font (if the
  559. '                         screen font is proportional).  Note that the font
  560. '                         must already be opened by you.  ReqTools will call
  561. '                         OpenFont() on this TextAttr, _not_ OpenDiskFont()!
  562. '                         If the font cannot be opened using OpenFont() or if
  563. '                         the font is proportional the default screen font
  564. '                         will be used (or the font set with RT_DefaultFont).
  565. '    RTFI_Flags         - (ULONG)
  566. '                         Several flags:
  567. '                           FREQF_NOBUFFER    - do _not_ use a buffer to
  568. '                                               remember directory contents
  569. '                                               for the next time the file
  570. '                                               requester is used.
  571. '                           FREQF_MULTISELECT - allow multiple files to be
  572. '                                               selected. rtFileRequest() will
  573. '                                               return a pointer to an
  574. '                                               rtFileList structure which
  575. '                                               will contain all selected
  576. '                                               files.  Use rtFreeFileList()
  577. '                                               to free the memory used by
  578. '                                               this file list.
  579. '                           FREQF_SELECTDIRS  - set this flag if you wish to
  580. '                                               enable the selecting of dirs
  581. '                                               as well as files.  You *must*
  582. '                                               also set FREQF_MULTISELECT.
  583. '                                               Directories will be returned
  584. '                                               together with files in
  585. '                                               rtFileList, but with StrLen
  586. '                                               equal to -1.  If you need the
  587. '                                               length of the directory's name
  588. '                                               use strlen().
  589. '                           FREQF_SAVE        - Set this if you are using the
  590. '                                               requester to save or delete
  591. '                                               something.  Double-clicking
  592. '                                               will be disabled so it is
  593. '                                               harder to make a mistake and
  594. '                                               select the wrong file.  If the
  595. '                                               user enters a non-existent
  596. '                                               directory in the drawer string
  597. '                                               gadget, a requester will
  598. '                                               appear asking if the directory
  599. '                                               should be created.
  600. '                           FREQF_NOFILES     - Set this if you want to use
  601. '                                               the requester to allow the
  602. '                                               user to select a directory
  603. '                                               rather than a file.  Ideal for
  604. '                                               getting a destination dir. May
  605. '                                               be used with FREQF_MULTISELECT
  606. '                                               and FREQF_SELECTDIRS.
  607. '                           FREQF_PATGAD      - When this is set a pattern
  608. '                                               gadget will be added to the
  609. '                                               requester.
  610. '    RTFI_Height        - (ULONG)
  611. '                         Suggested height of file requester window.
  612. '    RTFI_OkText        - (char *)
  613. '                         Replacement text for "Ok" gadget, max 6 chars long.
  614. '    RTFI_VolumeRequest - (ULONG) [V38]
  615. '                         The presence of this tag turns the file requester
  616. '                         into a volume/assign disk requester.  This requester
  617. '                         can be used to get a device name ("DF0:", "DH1:",..)
  618. '                         or an assign ("C:", "FONTS:",...) from the user.
  619. '                         The result of this requester can be found in the
  620. '                         filereq->Dir field.  The volume can also be changed
  621. '                         with rtChangeReqAttrA() and the RTFI_Dir tag.  Note
  622. '                         that the user may edit the disk/assign names, or
  623. '                         enter a new one.  Note also that the real device
  624. '                         name is returned, not the name of the volume in the
  625. '                         device.  For example "DH1:", not "Hard1:".
  626. '                         The tag data (ULONG) is used to set following flags:
  627. '                           VREQF_NOASSIGNS - Do not include the assigns in
  628. '                                             the list, only the real devices.
  629. '                           VREQF_NODISKS   - Do not include devices, just
  630. '                                             show the assigns.
  631. '                           VREQF_ALLDISKS  - Show _all_ devices.  Default
  632. '                                             behavior is to show only those
  633. '                                             devices which have valid disks
  634. '                                             inserted into them.  So if you
  635. '                                             have no disk in drive DF0: it
  636. '                                             will not show up.  Set this flag
  637. '                                             if you do want these devices
  638. '                                             included.
  639. '                         NOTE: Do *NOT* use { RTFI_VolumeRequest, TRUE }!
  640. '                               You are then setting the VREQF_NOASSIGNS flag!
  641. '                               Use { RTFI_VolumeRequest, 0 } for a normal
  642. '                               volume requester.
  643. '                         NOTE: If you use the RTFI_FilterFunc described
  644. '                               below the third parameter will be a pointer
  645. '                               to a rtVolumeEntry structure rather than a
  646. '                               pointer to a FileInfoBlock structure!
  647. '                               Tech note: the DOS device list has been
  648. '                               unlocked, so it is safe to e.g. Lock() this
  649. '                               device and call Info() on this lock.
  650. '                         NOTE: A file requester structure allocated with
  651. '                               rtAllocRequest() should not be used for both
  652. '                               a file and a volume requester. Allocate two
  653. '                               requester structures if you need both a file
  654. '                               and a volume requester in your program!
  655. '    RTFI_FilterFunc    - (struct Hook *) [V38]
  656. '                         Call this hook for each file in the directory being
  657. '                         read (or for each entry in the volume requester).
  658. '                         Parameters are as follows:
  659. '                           A0 - (struct Hook *) your hook
  660. '                           A2 - (struct rtFileRequester *) your filereq
  661. '                           A1 - (struct FileInfoBlock *) fib of file OR
  662. '                                (struct rtVolumeEntry *) device or assign
  663. '                                in case of a volume requester.
  664. '                         If your hook returns TRUE the file will be accepted.
  665. '                         If it returns FALSE the file will be skipped and
  666. '                         will not appear in the requester.
  667. '                         IMPORTANT NOTE: If you change your hook's behavior
  668. '                                         you _MUST_ purge the requester's
  669. '                                         buffer (using rtFreeReqBuffer())!
  670. '                         IMPORTANT NOTE: When this callback hook is called
  671. '                                         from a volume requester the
  672. '                                         pr_WindowPtr of your process will
  673. '                                         be set to -1 so *no* DOS requesters
  674. '                                         will appear when an error occurs!
  675. '    RTFI_AllowEmpty    - (BOOL) [V38]
  676. '                         If RTFI_AllowEmpty is TRUE an empty file string will
  677. '                         also be accepted and returned.  Defaults to FALSE,
  678. '                         meaning that if the user enters no filename the
  679. '                         requester will be canceled.  You should use this tag
  680. '                         as little as possible!
  681. '
  682. '  RESULT
  683. '    ret - TRUE if the user selected a file (check 'filereq->Dir' for the
  684. '          directory and 'filename' for the filename) or FALSE if the
  685. '          requester was canceled -- or a pointer to a struct rtFileList
  686. '          (if FREQF_MULTISELECT was used).
  687. '
  688. '  NOTE
  689. '    You CANNOT call the file requester from a task because it uses DOS calls!
  690. '
  691. '    Automatically adjusts the requester to the screen font.
  692. '    If the screen font is proportional the default font will be used.
  693. '
  694. '    If the requester got too big for the screen because of a very large font,
  695. '    the topaz.font will be used.
  696. '
  697. '    rtFileRequest() checks the pr_WindowPtr of your process to find the
  698. '    screen to put the requester on.
  699. '
  700. '  BUGS
  701. '    none known
  702. '
  703. '  SEE ALSO
  704. '
  705. '
  706. DECLARE FUNCTION rtFontRequestA& LIBRARY
  707. '
  708. '    bool = rtFontRequestA (fontreq, title, taglist);
  709. '
  710. '    BOOL rtFontRequestA (struct rtFontRequester *, char *, struct TagItem *);
  711. '    D0                   A1                        A3      A0
  712. '
  713. '  DESCRIPTION
  714. '    Let the user select a font and a style (optional).
  715. '
  716. '  INPUTS
  717. '    fontreq  - pointer to a struct rtFontRequester allocated with
  718. '               rtAllocRequestA().
  719. '    title    - pointer to requester window title (null terminated).
  720. '    taglist  - pointer to a TagItem array.
  721. '
  722. '  TAGS
  723. '    RT_Window         - see rtEZRequestA()
  724. '    RT_ReqPos         - see rtEZRequestA()
  725. '    RT_LeftOffset     - see rtEZRequestA()
  726. '    RT_TopOffset      - see rtEZRequestA()
  727. '    RT_PubScrName     - see rtEZRequestA()
  728. '    RT_Screen         - see rtEZRequestA()
  729. '    RT_ReqHandler     - see rtEZRequestA()
  730. '    RT_WaitPointer    - see rtEZRequestA()
  731. '    RT_LockWindow     - [V38] see rtEZRequestA()
  732. '    RT_ScreenToFront  - [V38] see rtEZRequestA()
  733. '    RT_ShareIDCMP     - [V38] see rtEZRequestA()
  734. '    RT_Locale         - [V38] see rtEZRequestA()
  735. '    RT_IntuiMsgFunc   - (struct Hook *) [V38]
  736. '                        The requester will call this hook for each IDCMP
  737. '                        message it gets that doesn't belong to its window.
  738. '                        Only applies if you used the RT_ShareIDCMP tag to
  739. '                        share the IDCMP port with the parent window.
  740. '                        Parameters are as follows:
  741. '                          A0 - (struct Hook *) your hook
  742. '                          A2 - (struct rtFontRequester *) your requester
  743. '                          A1 - (struct IntuiMessage *) the message
  744. '                        After you have finished examining the message and
  745. '                        your hook returns, ReqTools will reply the message.
  746. '                        So do not reply the message yourself!
  747. '    RT_Underscore     - (char) [V38]
  748. '                        Indicates the symbol that precedes the character in
  749. '                        a gadget's label to be underscored.  This will also
  750. '                        define the keyboard shortcut for this gadget.
  751. '                        Currently only needed for RTFO_OkText.  Usually set
  752. '                        to '_'.
  753. '    RT_DefaultFont    - (struct TextFont *)
  754. '                        This tag allows you to specify the font to be used in
  755. '                        the requester when the screen font is proportional.
  756. '                        Default is GfxBase->DefaultFont.
  757. '    RT_TextAttr       - [V38] see rtFileRequestA()
  758. '                        Remember: font cannot be proportional!
  759. '    RTFO_Flags        - (ULONG)
  760. '                        Several flags:
  761. '                          FREQF_NOBUFFER      - do not buffer the font list
  762. '                                                for subsequent calls to
  763. '                                                rtFontRequestA().
  764. '                          FREQF_FIXEDWIDTH    - only show fixed-width fonts.
  765. '                          FREQF_COLORFONTS    - show color fonts also.
  766. '                          FREQF_CHANGEPALETTE - change the screen's palette
  767. '                                                to match that of a selected
  768. '                                                color font.
  769. '                          FREQF_LEAVEPALETTE  - leave the palette as it is
  770. '                                                when exiting rtFontRequestA()
  771. '                                                Useful in combination with
  772. '                                                FREQF_CHANGEPALETTE.
  773. '                          FREQF_SCALE         - allow fonts to be scaled
  774. '                                                when they don't exist in the
  775. '                                                requested size.
  776. '                                                (works on Kickstart 2.0 only,                                                
  777. '                                                 has no effect on 1.2/1.3).
  778. '                          FREQF_STYLE         - include gadgets so the user
  779. '                                                may select the font's style.
  780. '    RTFO_Height       - (ULONG)
  781. '                        Suggested height of font requester window.
  782. '    RTFO_OkText       - (char *)
  783. '                        Replacement text for "Ok" gadget.  Maximum 6 chars.
  784. '                        (7 is still ok, but not esthetically pleasing)
  785. '    RTFO_SampleHeight - (ULONG)
  786. '                        Height of font sample display in pixels (default 24).
  787. '    RTFO_MinHeight    - (ULONG)
  788. '                        Minimum font size displayed.
  789. '    RTFO_MaxHeight    - (ULONG)
  790. '                        Maximum font size displayed.
  791. '    RTFO_FilterFunc   - (struct Hook *) [V38]
  792. '                        Call this hook for each available font.
  793. '                        Parameters are as follows:
  794. '                          A0 - (struct Hook *) your hook
  795. '                          A2 - (struct rtFontRequester *) your filereq
  796. '                          A1 - (struct TextAttr *) textattr of font
  797. '                        If your hook returns TRUE the font will be accepted.
  798. '                        If it returns FALSE the font will be skipped and
  799. '                        will not appear in the requester.
  800. '                        IMPORTANT NOTE:  If you change your hook's behavior
  801. '                        you _MUST_ purge the requester's buffer (using
  802. '                        rtFreeReqBuffer())!
  803. '
  804. '  RESULT
  805. '    bool - TRUE if the user selected a font (freq->Attr holds the font),
  806. '           FALSE if the requester was canceled.
  807. '
  808. '  NOTE
  809. '    You CANNOT call the font requester from a task because it may use DOS
  810. '    calls!
  811. '
  812. '    Automatically adjusts the requester to the screen font.
  813. '    If the screen font is proportional the default font will be used.
  814. '
  815. '    If the requester got too big for the screen because of a very large font,
  816. '    the topaz.font will be used.
  817. '
  818. '    rtFontRequest() checks the pr_WindowPtr of your process to find the
  819. '    screen to put the requester on.
  820. '
  821. '  BUGS
  822. '    none known
  823. '
  824. '  SEE ALSO
  825. '
  826. '
  827. DECLARE SUB rtFreeFileList LIBRARY
  828. '
  829. '    rtFreeFileList (filelist);
  830. '
  831. '    void rtFreeFileList (struct rtFileList *);
  832. '                         A0
  833. '
  834. '  DESCRIPTION
  835. '    Frees a filelist returned by rtFileRequest() when the FREQF_MULTISELECT
  836. '    flag was set.  Call this after you have scanned the filelist and you no
  837. '    longer need it.
  838. '
  839. '  INPUTS
  840. '    filelist - pointer to rtFileList structure, returned by rtFileRequest()
  841. '               (may be NULL).
  842. '
  843. '  RESULT
  844. '    none
  845. '
  846. '  BUGS
  847. '    none known
  848. '
  849. '  SEE ALSO
  850. '    rtFileRequest()
  851. '
  852. '
  853. DECLARE SUB rtFreeReqBuffer() LIBRARY
  854. '
  855. '    rtFreeReqBuffer (req);
  856. '
  857. '    void rtFreeReqBuffer (APTR);
  858. '                          A1
  859. '
  860. '  DESCRIPTION
  861. '    Frees the buffer associated with 'req'.  In case of a file requester this
  862. '    function will deallocate the directory buffer, in case of a font
  863. '    requester the font list.
  864. '
  865. '    It is safe to call this function for requesters that have no buffer, so
  866. '    you may call this for all requesters to free as much memory as possible.
  867. '
  868. '  INPUTS
  869. '    req - pointer to requester.
  870. '
  871. '  RESULT
  872. '    none
  873. '
  874. '  BUGS
  875. '    none known
  876. '
  877. '  SEE ALSO
  878. '    rtFileRequest(), rtFontRequest()
  879. '
  880. '
  881. DECLARE SUB rtFreeRequest() LIBRARY
  882. '
  883. '    rtFreeRequest (req);
  884. '
  885. '    void rtFreeRequest (APTR);
  886. '                        A1
  887. '
  888. '  DESCRIPTION
  889. '    Free requester structure previously allocated by rtAllocRequestA().
  890. '    This will also free all buffers associated with the requester, so there
  891. '    is no need to call rtFreeReqBuffer() first.
  892. '
  893. '  INPUTS
  894. '    req - pointer to requester (may be NULL).
  895. '
  896. '  RESULT
  897. '    none
  898. '
  899. '  BUGS
  900. '    none known
  901. '
  902. '  SEE ALSO
  903. '    rtAllocRequestA()
  904. '
  905. '
  906. DECLARE FUNCTION rtGetLongA& LIBRARY
  907. '
  908. '    ret = rtGetLongA (&longvar, title, reqinfo, taglist);
  909. '
  910. '    ULONG rtGetLongA (ULONG *, char *, struct rtReqInfo *, struct TagItem *);
  911. '    D0                A1       A2      A3                  A0
  912. '
  913. '  DESCRIPTION
  914. '    Puts up a requester to get a signed long (32-bit) number from the user.
  915. '
  916. '    'reqinfo' can be used to customize the requester.  For greater control
  917. '    use the tags listed below.  The advantage of the rtReqInfo structure is
  918. '    that it is global, where tags have to be specified each function call.
  919. '    See libraries/reqtools.[hi] for a description of the rtReqInfo structure.
  920. '
  921. '  INPUTS
  922. '    &longvar - address of long (32 bit!) variable to hold result.
  923. '    title    - pointer to null terminated title of requester window.
  924. '    reqinfo  - pointer to a rtReqInfo structure allocated with
  925. '               rtAllocRequest() or NULL.
  926. '    taglist  - pointer to a TagItem array.
  927. '
  928. '  TAGS
  929. '    RT_Window        - see rtEZRequestA()
  930. '    RT_IDCMPFlags    - see rtEZRequestA()
  931. '    RT_ReqPos        - see rtEZRequestA()
  932. '    RT_LeftOffset    - see rtEZRequestA()
  933. '    RT_TopOffset     - see rtEZRequestA()
  934. '    RT_PubScrName    - see rtEZRequestA()
  935. '    RT_Screen        - see rtEZRequestA()
  936. '    RT_ReqHandler    - see rtEZRequestA()
  937. '    RT_WaitPointer   - see rtEZRequestA()
  938. '    RT_Underscore    - [V38] see rtEZRequestA()
  939. '                       Only when you also use the RTGL_GadFmt tag.
  940. '    RT_LockWindow    - [V38] see rtEZRequestA()
  941. '    RT_ScreenToFront - [V38] see rtEZRequestA()
  942. '    RT_ShareIDCMP    - [V38] see rtEZRequestA()
  943. '    RT_Locale        - [V38] see rtEZRequestA()
  944. '    RT_IntuiMsgFunc  - [V38] see rtEZRequestA()
  945. '    RT_TextAttr      - [V38] see rtEZRequestA()
  946. '                       Note that under 1.2/1.3 the string gadget's font
  947. '                       will remain the screen font.
  948. '    RTGL_Min         - (ULONG)
  949. '                       Minimum allowed value. If the user tries to enter a
  950. '                       smaller value the requester will refuse to accept it.
  951. '    RTGL_Max         - (ULONG)
  952. '                       Maximum allowed value, higher values are refused.
  953. '    RTGL_Width       - (ULONG)
  954. '                       Width of requester window in pixels.  This is only a
  955. '                       suggestion. rtGetLongA() will not go below a
  956. '                       certain width.
  957. '    RTGL_ShowDefault - (BOOL)
  958. '                       If this is TRUE (default) the value already in
  959. '                       'longvar' will be displayed in the requester when it
  960. '                       comes up. If set to FALSE the requester will be empty.
  961. '    RTGL_GadFmt      - (char *) [V38]
  962. '                       Using this tag you can offer the user several
  963. '                       responses.  See rtEZRequestA() for more information.
  964. '                       Note that selecting this gadget is considered a
  965. '                       positive response so the integer in the gadget is
  966. '                       copied to '&longvar'.
  967. '    RTGL_GadFmtArgs  - (APTR) [V38]
  968. '                       If you used formatting codes with RTGL_GadFmt use this
  969. '                       tag to pass the arguments.
  970. '    RTGL_Invisible   - (BOOL) [V38]
  971. '                       Using this tag you can switch on invisible typing.
  972. '                       Very useful if you need to get something like a
  973. '                       code number from the user.  It is strongly advised to
  974. '                       use { RTGL_ShowDefault, FALSE } or the user may get 
  975. '                       very confused!  Default is FALSE.
  976. '    RTGL_BackFill    - (BOOL) [V38]
  977. '                       Backfill requester window with pattern.  Default TRUE.
  978. '    RTGL_TextFmt     - (char *) [V38]
  979. '                       Print these lines of text above the gadget in the
  980. '                       requester.  Very useful to inform the user of what
  981. '                       he should enter.  Most of the time you will also want
  982. '                       to set the GLREQF_CENTERTEXT flag.  If you set the
  983. '                       RTGL_BackFill tag to FALSE _no_ recessed border will
  984. '                       be placed around the text.  Formatting codes may be
  985. '                       used in the string (see RTGL_TextFmtArgs tag).
  986. '    RTGL_TextFmtArgs - (APTR) [V38]
  987. '                       If you used formatting codes with RTGL_TextFmt use
  988. '                       this tag to pass the arguments.
  989. '    RTGL_Flags       - (ULONG) [V38]
  990. '                         GLREQF_CENTERTEXT    - centers each line of text
  991. '                                                above the gadget in the
  992. '                                                requester window. Should
  993. '                                                be generally set.
  994. '                         GLREQF_HIGHLIGHTTEXT - Highlight text above the
  995. '                                                gadget. You will normally
  996. '                                                only want to use this if you
  997. '                                                also turned off the window
  998. '                                                backfilling.
  999. '
  1000. '  RESULT
  1001. '    ret - TRUE if user entered a number, FALSE if not. If one of your idcmp
  1002. '          flags caused the requester to end 'ret' will hold this flag.
  1003. '          If you used the RTGL_GadFmt tag the return code will hold the
  1004. '          value of the response as with rtEZRequestA().
  1005. '
  1006. '  NOTE
  1007. '    'longvar' will NOT change if the requester is aborted.
  1008. '
  1009. '    Automatically adjusts the requester to the screen font.
  1010. '
  1011. '    rtGetLongA() checks the pr_WindowPtr of your process to find the
  1012. '    screen to put the requester on.
  1013. '
  1014. '    If you use the RTGL_GadFmt tag the return value is not always the gadget
  1015. '    the user selected.  If the integer gadget is empty and the user presses
  1016. '    the leftmost gadget (normally 'Ok') rtGetLong() will return 0 (FALSE)!
  1017. '    If the integer gadget is empty and the user presses one of the other
  1018. '    gadgets rtGetLong() _will_ return its value!  Important: &longvar will
  1019. '    not be changed in either of these cases.
  1020. '
  1021. '  BUGS
  1022. '    none known
  1023. '
  1024. '  SEE ALSO
  1025. '
  1026. '
  1027. DECLARE FUNCTION rtGetStringA& LIBRARY
  1028. '
  1029. '    ret = rtGetStringA (buffer, maxchars, title, reqinfo, taglist);
  1030. '
  1031. '    ULONG rtGetStringA
  1032. '              (UBYTE *, ULONG, char *, struct rtReqInfo *, struct TagItem *);
  1033. '    D0         A1       D0     A2      A3                  A0
  1034. '
  1035. '    ret = rtGetString (buffer, maxchars, title, reqinfo, tag1,...);
  1036. '
  1037. '    ULONG rtGetString (UBYTE *, ULONG, char *, struct rtReqInfo *, Tag,...);
  1038. '
  1039. '  DESCRIPTION
  1040. '    Puts up a string requester to get a line of text from the user.
  1041. '    The string present in 'buffer' upon entry will be displayed, ready to
  1042. '    be edited.
  1043. '
  1044. '    'reqinfo' can be used to customize the requester.  For greater control
  1045. '    use the tags listed below.  The advantage of the rtReqInfo structure is
  1046. '    that it is global, where tags have to be specified each function call.
  1047. '    See libraries/reqtools.[hi] for a description of the rtReqInfo structure.
  1048. '
  1049. '  INPUTS
  1050. '    buffer   - pointer to buffer to hold characters entered.
  1051. '    maxchars - maximum number of characters that fit in buffer (EX-cluding
  1052. '               the 0 to terminate the string !).
  1053. '    title    - pointer to null terminated title of requester window.
  1054. '    reqinfo  - pointer to a rtReqInfo structure allocated with
  1055. '               rtAllocRequest() or NULL.
  1056. '    taglist  - pointer to a TagItem array.
  1057. '
  1058. '  TAGS
  1059. '    RT_Window        - see rtEZRequestA()
  1060. '    RT_IDCMPFlags    - see rtEZRequestA()
  1061. '    RT_ReqPos        - see rtEZRequestA()
  1062. '    RT_LeftOffset    - see rtEZRequestA()
  1063. '    RT_TopOffset     - see rtEZRequestA()
  1064. '    RT_PubScrName    - see rtEZRequestA()
  1065. '    RT_Screen        - see rtEZRequestA()
  1066. '    RT_ReqHandler    - see rtEZRequestA()
  1067. '    RT_WaitPointer   - see rtEZRequestA()
  1068. '    RT_Underscore    - [V38] see rtEZRequestA()
  1069. '                       Only when you also use the RTGS_GadFmt tag.
  1070. '    RT_LockWindow    - [V38] see rtEZRequestA()
  1071. '    RT_ScreenToFront - [V38] see rtEZRequestA()
  1072. '    RT_ShareIDCMP    - [V38] see rtEZRequestA()
  1073. '    RT_Locale        - [V38] see rtEZRequestA()
  1074. '    RT_IntuiMsgFunc  - [V38] see rtEZRequestA()
  1075. '    RT_TextAttr      - [V38] see rtEZRequestA()
  1076. '                       Note that under 1.2/1.3 the string gadget's font
  1077. '                       will remain the screen font.
  1078. '    RTGS_Width       - (ULONG)
  1079. '                       Width of requester window in pixels.  This is only a
  1080. '                       suggestion. rtGetStringA() will not go below a certain
  1081. '                       width.
  1082. '    RTGS_AllowEmpty  - (BOOL)
  1083. '                       If RTGS_AllowEmpty is TRUE an empty string will also
  1084. '                       be accepted and returned.  Defaults to FALSE, meaning
  1085. '                       that if the user enters an empty string the requester
  1086. '                       will be canceled.
  1087. '    RTGS_GadFmt      - (char *) [V38]
  1088. '                       Using this tag you can offer the user several
  1089. '                       responses.  See rtEZRequestA() for more information.
  1090. '                       Note that selecting this gadget is considered a
  1091. '                       positive response so the string in the gadget is
  1092. '                       copied to 'buffer'.
  1093. '    RTGS_GadFmtArgs  - (APTR) [V38]
  1094. '                       If you used formatting codes with RTGS_GadFmt use this
  1095. '                       tag to pass the arguments.
  1096. '    RTGS_Invisible   - (BOOL) [V38]
  1097. '                       Using this tag you can switch on invisible typing.
  1098. '                       Very useful if you need to get something like a
  1099. '                       password from the user.  It is strongly advised to use
  1100. '                       an empty initial string or the user may get very
  1101. '                       confused!  Default is FALSE.
  1102. '    RTGS_BackFill    - (BOOL) [V38]
  1103. '                       Backfill requester window with pattern.  Default TRUE.
  1104. '    RTGS_TextFmt     - (char *) [V38]
  1105. '                       Print these lines of text above the gadget in the
  1106. '                       requester.  Very useful to inform the user of what
  1107. '                       he should enter.  Most of the time you will also want
  1108. '                       to set the GSREQF_CENTERTEXT flag.  If you set the
  1109. '                       RTGS_BackFill tag to FALSE _no_ recessed border will
  1110. '                       be placed around the text.  Formatting codes may be
  1111. '                       used in the string (see RTGS_TextFmtArgs tag).
  1112. '    RTGS_TextFmtArgs - (APTR) [V38]
  1113. '                       If you used formatting codes with RTGS_TextFmt use
  1114. '                       this tag to pass the arguments.
  1115. '    RTGS_Flags       - (ULONG) [V38]
  1116. '                         GSREQF_CENTERTEXT    - centers each line of text
  1117. '                                                above the gadget in the
  1118. '                                                requester window. Should
  1119. '                                                be generally set.
  1120. '                         GSREQF_HIGHLIGHTTEXT - Highlight text above the
  1121. '                                                gadget. You will normally
  1122. '                                                only want to use this if you
  1123. '                                                also turned off the window
  1124. '                                                backfilling.
  1125. '
  1126. '  RESULT
  1127. '    ret - TRUE if user entered something, FALSE if not. If one of your idcmp
  1128. '          flags caused the requester to end 'ret' will hold this flag.
  1129. '          If you used the RTGS_GadFmt tag the return code will hold the
  1130. '          value of the response as with rtEZRequestA().
  1131. '
  1132. '  NOTE
  1133. '    The contents of the buffer will NOT change if the requester is aborted.
  1134. '
  1135. '    Automatically adjusts the requester to the screen font.
  1136. '
  1137. '    rtGetStringA() checks the pr_WindowPtr of your process to find the
  1138. '    screen to put the requester on.
  1139. '
  1140. '    If you use the RTGS_GadFmt tag the return value is not always the gadget
  1141. '    the user selected.  If the string gadget is empty and the user presses
  1142. '    the leftmost gadget (normally 'Ok') rtGetString() will return 0 (FALSE)!
  1143. '    If the string gadget is empty and the user presses one of the other
  1144. '    gadgets rtGetString() _will_ return its value!  Important: 'buffer' will
  1145. '    not be changed in either of these cases.
  1146. '    If you set the RTGS_AllowEmpty tag to TRUE 'buffer' will always be
  1147. '    changed of course, and rtGetString() will always return the value of the
  1148. '    gadget pressed.
  1149. '
  1150. '  BUGS
  1151. '    none known
  1152. '
  1153. '  SEE ALSO
  1154. '
  1155. '
  1156. DECLARE SUB rtGetVScreenSize LIBRARY
  1157. '
  1158. '    rtGetVScreenSize (screen, widthptr, heightptr);
  1159. '
  1160. '    ULONG rtGetVScreenSize (struct Screen *, ULONG *, ULONG *);
  1161. '    D0                      A0               A1       A2
  1162. '
  1163. '  DESCRIPTION
  1164. '    Use this function to get the size of the visible portion of a screen.
  1165. '
  1166. '    The value returned by rtGetVScreenSize() can be used for vertical
  1167. '    spacing.  It will be larger for interlaced and productivity screens.
  1168. '    Using this number for spacing will assure your requester will look
  1169. '    good on an interlaced and a non-interlaced screen.
  1170. '
  1171. '    Current return codes are 2 for non-interlaced and 4 for interlaced.
  1172. '    These values may change in the future, don't depend on them too much.
  1173. '    They will in any case remain of the same magnitude.
  1174. '
  1175. '  INPUTS
  1176. '    screen    - pointer to the screen.
  1177. '    widthptr  - address of an ULONG variable to hold the width.
  1178. '    heightptr - address of an ULONG variable to hold the height.
  1179. '
  1180. '  RESULT
  1181. '    none
  1182. '
  1183. '  NOTE
  1184. '    This function is for the advanced ReqTools user.
  1185. '
  1186. '  BUGS
  1187. '
  1188. '  SEE ALSO
  1189. '
  1190. '
  1191. DECLARE FUNCTION rtLockWindow& LIBRARY '[V38]
  1192. '
  1193. '    windowlock = rtLockWindow (window);
  1194. '
  1195. '    APTR rtLockWindow (struct Window *);
  1196. '    D0                 A0
  1197. '
  1198. '  DESCRIPTION
  1199. '    Lock a window so it will no longer accept any user input.  The only
  1200. '    functions left to the user are depth arrangement and window dragging.
  1201. '    All gadgets will be un-selectable and the window can not be resized.
  1202. '    It will also get the standard wait pointer set.  The pointer at the
  1203. '    time of locking will be restored when the window is unlocked.
  1204. '
  1205. '    You may nest calls to rtLockWindow() and rtUnlockWindow().  Just make
  1206. '    sure you unlock the window in the correct (opposite) order.
  1207. '
  1208. '    See the RT_LockWindow tag for an automatic way of locking your window.
  1209. '
  1210. '    Use this function (and rtUnlockWindow()) instead of rtSetWaitPointer().
  1211. '
  1212. '  INPUTS
  1213. '    window - pointer to the window to be locked.
  1214. '
  1215. '  RESULT
  1216. '    windowlock - a pointer to a (private) window lock.  You must pass this
  1217. '                 to rtUnlockWindow() to unlock the window again.
  1218. '                 Never mind if this is NULL.  This means there was not enough
  1219. '                 memory and the window will not be locked.  There is no
  1220. '                 sense in reporting this, just carry on and pass the NULL
  1221. '                 window lock to rtUnlockWindow().
  1222. '
  1223. '  NOTE
  1224. '    The wait pointer will look exactly like the standard Workbench 2.0
  1225. '    wait pointer.  In combination with PointerX, ClockTick or LacePointer
  1226. '    the handle will turn.
  1227. '
  1228. '  BUGS
  1229. '    none known
  1230. '
  1231. '  SEE ALSO
  1232. '
  1233. '
  1234. DECLARE FUNCTION rtPaletteRequestA& LIBRARY
  1235. '
  1236. '    color = rtPaletteRequestA (title, reqinfo, taglist);
  1237. '
  1238. '    LONG rtPaletteRequestA (char *, struct rtReqInfo *, struct TagItem *);
  1239. '    D0                      A2      A3                  A0
  1240. '
  1241. '  DESCRIPTION
  1242. '    Put up a palette requester so the user can change the screen's colors.
  1243. '
  1244. '    The colors are changed in the viewport of the screen the requester will
  1245. '    appear on, so that is where you will find them after the palette
  1246. '    requester returns.
  1247. '
  1248. '    The selected color is returned, so you can also use this requester to let
  1249. '    the user select a color.
  1250. '
  1251. '    'reqinfo' can be used to customize the requester.  For greater control
  1252. '    use the tags listed below.  The advantage of the rtReqInfo structure is
  1253. '    that it is global, where tags have to be specified each function call.
  1254. '    See libraries/reqtools.[hi] for a description of the rtReqInfo structure.
  1255. '
  1256. '  INPUTS
  1257. '    title   - pointer to requester window title (null terminated).
  1258. '    reqinfo - pointer to a rtReqInfo structure allocated with
  1259. '              rtAllocRequest() or NULL.
  1260. '    taglist - pointer to a TagItem array.
  1261. '
  1262. '  TAGS
  1263. '    RT_Window        - see rtEZRequestA()
  1264. '    RT_ReqPos        - see rtEZRequestA()
  1265. '    RT_LeftOffset    - see rtEZRequestA()
  1266. '    RT_TopOffset     - see rtEZRequestA()
  1267. '    RT_PubScrName    - see rtEZRequestA()
  1268. '    RT_Screen        - see rtEZRequestA()
  1269. '    RT_ReqHandler    - see rtEZRequestA()
  1270. '    RT_WaitPointer   - see rtEZRequestA()
  1271. '    RT_LockWindow    - [V38] see rtEZRequestA()
  1272. '    RT_ScreenToFront - [V38] see rtEZRequestA()
  1273. '    RT_ShareIDCMP    - [V38] see rtEZRequestA()
  1274. '    RT_Locale        - [V38] see rtEZRequestA()
  1275. '    RT_IntuiMsgFunc  - [V38] see rtEZRequestA()
  1276. '    RT_DefaultFont   - (struct TextFont *)
  1277. '                       This tag allows you to specify the font to be used in
  1278. '                       the requester when the screen font is proportional.
  1279. '                       Default is GfxBase->DefaultFont.
  1280. '    RT_TextAttr      - [V38] see rtFileRequestA()
  1281. '                       Remember: font cannot be proportional!
  1282. '    RTPA_Color       - (ULONG)
  1283. '                       Initially selected color of palette.  Default is 1.
  1284. '
  1285. '  RESULT
  1286. '    color - the color number of the selected color or -1 if the user
  1287. '            canceled the requester.
  1288. '
  1289. '  NOTE
  1290. '    Automatically adjusts the requester to the screen font.
  1291. '    If the screen font is proportional the default font will be used.
  1292. '
  1293. '    If the requester got too big for the screen because of a very large font,
  1294. '    the topaz.font will be used.
  1295. '
  1296. '    rtPaletteRequestA() checks the pr_WindowPtr of your process to find the
  1297. '    screen to put the requester on.
  1298. '
  1299. '  BUGS
  1300. '    none known
  1301. '
  1302. '  SEE ALSO
  1303. '
  1304. '
  1305. DECLARE FUNCTION rtReqHandlerA& LIBRARY
  1306. '
  1307. '    ret = rtReqHandlerA (handlerinfo, sigs, taglist);
  1308. '
  1309. '    ULONG rtReqHandlerA (struct rtHandlerInfo *, ULONG, struct TagItem *);
  1310. '    D0                   A1                      D0     A0
  1311. '
  1312. '  DESCRIPTION
  1313. '    This function should be called if you used the RT_ReqHandler tag with a
  1314. '    requester function.
  1315. '
  1316. '    The requester you used the tag with will have returned immediately after
  1317. '    its initialization and will have initialized a pointer to a rtHandlerInfo
  1318. '    structure for you.
  1319. '    You should now do the following:
  1320. '
  1321. '    Check the DoNotWait field. If it is FALSE you have to wait for the
  1322. '    signals in the WaitMask field (plus your own signals if you like).
  1323. '    If any of the signals in WaitMask are received or DoNotWait was not FALSE
  1324. '    you have to call rtReqHandlerA() and check its return value for one of
  1325. '    the following values:
  1326. '
  1327. '      CALL_HANDLER    - Check DoNotWait again, Wait() if you have to
  1328. '                        and call rtReqHandlerA() again. In other words, loop.
  1329. '      everything else - normal return value, requester has finished. This
  1330. '                        return value will be the same as if the requester
  1331. '                        had run normally.
  1332. '
  1333. '    You must pass the signals you received to rtReqHandlerA().
  1334. '
  1335. '    NOTE: if you want to wait for your own signals do not do so if
  1336. '          DoNotWait is TRUE.  Call rtReqHandlerA() and if you must know
  1337. '          if one of your signals arrived use SetSignal() to find this out.
  1338. '          If you are waiting for a message to arrive at a message port you
  1339. '          can simple call GetMsg() and check if it is non-null.
  1340. '          DoNotWait will naturally only be TRUE when it absolutely,
  1341. '          positively has to be.  A multitasking machine as the Amiga should
  1342. '          use Wait() as much as possible.
  1343. '
  1344. '    This is an example of a "requester loop":
  1345. '
  1346. '    ...
  1347. '    struct rtHandlerInfo *hinfo;
  1348. '    ULONG ret, mymask, sigs;
  1349. '
  1350. '    ...
  1351. '       /* calculate our mask */
  1352. '       mymask = 1 << win->UserPort->mp_SigBit;
  1353. '
  1354. '       /* We use the RT_ReqHandler tag to cause the requester to return
  1355. '          after initializing.
  1356. '          Check the return value to see if this setup went ok. */
  1357. '       if (rtFontRequest (req, "Font", RT_ReqHandler, &hinfo, TAG_END)
  1358. '                                                           == CALL_HANDLER) {
  1359. '          do {
  1360. '            /* Wait() if we can */
  1361. '            if (!hinfo->DoNotWait)
  1362. '               sigs = Wait (hinfo->WaitMask | mymask);
  1363. '
  1364. '            /* check our own message port */
  1365. '            while (msg = GetMsg (win->UserPort)) {
  1366. '               ...
  1367. '               /* here we handle messages received at our windows IDCMP               ...
  1368. '                  port */
  1369. '               ...
  1370. '               }
  1371. '
  1372. '            /* let the requester do its thing (remember to pass 'sigs') */
  1373. '            ret = rtReqHandler (hinfo, sigs, TAG_END);
  1374. '
  1375. '            /* continue this loop as long as the requester is up */
  1376. '            } while (ret == CALL_HANDLER)
  1377. '
  1378. '          /* when we get here we know the requester has finished, 'ret'
  1379. '             is the return code. */
  1380. '          ...
  1381. '          }
  1382. '       else notify ("Error opening requester!");
  1383. '    ...
  1384. '
  1385. '  INPUTS
  1386. '    handlerinfo - pointer to handler info structure initialized by using
  1387. '                  the RT_ReqHandler tag when calling a requester function.
  1388. '    sigs        - the signals received by previous wait, will be ignored if
  1389. '                  hinfo->DoNotWait was TRUE.
  1390. '    taglist     - pointer to a TagItem array.
  1391. '
  1392. '  TAGS
  1393. '    RTRH_EndRequest - supplying this tag will end the requester. The return
  1394. '                      code from rtReqHandlerA() will _not_ be CALL_HANDLER,
  1395. '                      but the requester return code.  If the tagdata of this
  1396. '                      tag is REQ_CANCEL the requester will be canceled, if it
  1397. '                      is REQ_OK the requester will be ok-ed.
  1398. '                      In case of an EZRequest tagdata should be the return
  1399. '                      code of the requester (TRUE, FALSE or 2,3,4,...).
  1400. '
  1401. '  RESULT
  1402. '    ret - CALL_HANDLER if you have to call rtReqHandlerA() again,
  1403. '          or the normal return value from the requester.
  1404. '
  1405. '  BUGS
  1406. '    none known
  1407. '
  1408. '  SEE ALSO
  1409. '    rtEZRequest() (RT_ReqHandler explanation)
  1410. '
  1411. '
  1412. DECLARE FUNCTION rtScreenModeRequestA& LIBRARY '[V38]
  1413. '
  1414. '    ret = rtScreenModeRequestA (screenmodereq, title, taglist);
  1415. '
  1416. '    BOOL rtScreenModeRequestA 
  1417. '                  (struct rtScreenModeRequester *, char *, struct TagItem *);
  1418. '    D0             A1                              A3      A0
  1419. '
  1420. '  DESCRIPTION
  1421. '
  1422. '    *IMPORTANT* THIS REQUESTER IS ONLY AVAILABLE FROM KICKSTART 2.0 ONWARDS!
  1423. '                The 1.3 version of ReqTools also contains the screenmode
  1424. '                requester, but unless you are running 2.0 or higher it will
  1425. '                not come up.  So what you essentially have to do is NOT
  1426. '                call rtScreenModeRequestA() if your program is running on
  1427. '                a machine with Kickstart 1.2/1.3.  You can safely call
  1428. '                rtScreenModeRequestA() if you are running on a 2.0 machine,
  1429. '                even if the user has installed the 1.3 version of ReqTools.
  1430. '
  1431. '    Get a screen mode from the user.
  1432. '
  1433. '    The user will be able to pick a screen mode by name, enter the size and
  1434. '    the number of colors (bitplane depth).
  1435. '
  1436. '    rtScreenModeRequestA() will call the appropriate 2.0 functions to get all
  1437. '    the mode's information.  If no name has been assigned to the mode one
  1438. '    will be constructed automatically.
  1439. '
  1440. '  INPUTS
  1441. '    screenmodereq - pointer to a struct rtScreenModeRequester allocated with
  1442. '                    rtAllocRequestA().
  1443. '    title         - pointer to requester window title (null terminated).
  1444. '    taglist       - pointer to a TagItem array.
  1445. '
  1446. '  TAGS
  1447. '    RT_Window          - see rtEZRequestA()
  1448. '    RT_ReqPos          - see rtEZRequestA()
  1449. '    RT_LeftOffset      - see rtEZRequestA()
  1450. '    RT_TopOffset       - see rtEZRequestA()
  1451. '    RT_PubScrName      - see rtEZRequestA()
  1452. '    RT_Screen          - see rtEZRequestA()
  1453. '    RT_ReqHandler      - see rtEZRequestA()
  1454. '    RT_WaitPointer     - see rtEZRequestA()
  1455. '    RT_LockWindow      - see rtEZRequestA()
  1456. '    RT_ScreenToFront   - see rtEZRequestA()
  1457. '    RT_ShareIDCMP      - see rtEZRequestA()
  1458. '    RT_Locale          - see rtEZRequestA()
  1459. '    RT_IntuiMsgFunc    - (struct Hook *) [V38]
  1460. '                         The requester will call this hook for each IDCMP
  1461. '                         message it gets that doesn't belong to its window.
  1462. '                         Only applies if you used the RT_ShareIDCMP tag to
  1463. '                         share the IDCMP port with the parent window.
  1464. '                         Parameters are as follows:
  1465. '                           A0 - (struct Hook *) your hook
  1466. '                           A2 - (struct rtScreenModeRequester *) your req
  1467. '                           A1 - (struct IntuiMessage *) the message
  1468. '                         After you have finished examining the message and
  1469. '                         your hook returns, ReqTools will reply the message.
  1470. '                         So do not reply the message yourself!
  1471. '    RT_Underscore      - (char) [V38]
  1472. '                         Indicates the symbol that precedes the character in
  1473. '                         a gadget's label to be underscored.  This will also
  1474. '                         define the keyboard shortcut for this gadget.
  1475. '                         Currently only needed for RTSC_OkText.  Usually set
  1476. '                         to '_'.
  1477. '    RT_DefaultFont     - (struct TextFont *)
  1478. '                         This tag allows you to specify the font to be used
  1479. '                         in the requester when the screen font is
  1480. '                         proportional.  Default is GfxBase->DefaultFont.
  1481. '    RT_TextAttr        - [V38] see rtFileRequestA()
  1482. '                         Remember: font cannot be proportional!
  1483. '    RTSC_Flags         - (ULONG)
  1484. '                         Several flags:
  1485. '                           SCREQF_OVERSCANGAD   - Add an overscan cycle
  1486. '                                                  gadget to the requester.
  1487. '                                                  After the requester returns
  1488. '                                                  you may read the overscan
  1489. '                                                  type in 'rq->OverscanType'
  1490. '                                                  If this is 0 no overscan is
  1491. '                                                  selected (Regular Size), if
  1492. '                                                  non-zero it holds one of
  1493. '                                                  the OSCAN_... values
  1494. '                                                  defined in the include file
  1495. '                                                  'intuition/screens.[h|i]'.
  1496. '                           SCREQF_AUTOSCROLLGAD - Add an autoscroll checkbox
  1497. '                                                  gadget to the requester.
  1498. '                                                  After the requester returns
  1499. '                                                  read 'smreq->AutoScroll' to
  1500. '                                                  see if the user prefers
  1501. '                                                  autoscroll to be on or off.
  1502. '                           SCREQF_SIZEGADS      - Add width and height
  1503. '                                                  gadgets to the requester.
  1504. '                                                  If you do not add these
  1505. '                                                  gadgets the width and
  1506. '                                                  height returned will be the
  1507. '                                                  default width and height
  1508. '                                                  for the selected overscan
  1509. '                                                  type.
  1510. '                           SCREQF_DEPTHGAD      - Add a depth slider gadget
  1511. '                                                  to the requester.  If you
  1512. '                                                  do not add a depth gadget,
  1513. '                                                  the depth returned will be
  1514. '                                                  the maximum depth this mode
  1515. '                                                  can be opened in.
  1516. '                           SCREQF_NONSTDMODES   - Include all modes. Unless
  1517. '                                                  this flag is set
  1518. '                                                  rtScreenModeRequestA()
  1519. '                                                  will exclude nonstandard
  1520. '                                                  modes.  Nonstandard modes
  1521. '                                                  are presently HAM and EHB
  1522. '                                                  (ExtraHalfBrite). So unless
  1523. '                                                  you are picking a mode to
  1524. '                                                  do some rendering in leave
  1525. '                                                  this flag unset.  Without
  1526. '                                                  this flag set the mode
  1527. '                                                  returned will be a normal
  1528. '                                                  bitplaned mode.
  1529. '                           SCREQF_GUIMODES      - Set this flag if you are
  1530. '                                                  getting a screen mode to
  1531. '                                                  open a user interface
  1532. '                                                  screen in.  The modes
  1533. '                                                  shown will be standard
  1534. '                                                  modes with a high enough
  1535. '                                                  resolution (minumum 640
  1536. '                                                  pixels).  If this flag is
  1537. '                                                  set the SCREQF_NONSTDMODES
  1538. '                                                  flag is ignored.
  1539. '    RTSC_Height        - (ULONG)
  1540. '                         Suggested height of screenmode requester window.
  1541. '    RTSC_OkText        - (char *)
  1542. '                         Replacement text for "Ok" gadget, max 6 chars long.
  1543. '    RTSC_MinWidth      - (UWORD)
  1544. '                         The minimum display width allowed.
  1545. '    RTSC_MaxWidth      - (UWORD)
  1546. '                         The maximum display width allowed.
  1547. '    RTSC_MinHeight     - (UWORD)
  1548. '                         The minimum display height allowed.
  1549. '    RTSC_MaxHeight     - (UWORD)
  1550. '                         The maximum display height allowed.
  1551. '    RTSC_MinDepth      - (UWORD)
  1552. '                         The minimum display depth allowed.  Modes with a
  1553. '                         minimum display depth lower than this value will not
  1554. '                         be included in the list.
  1555. '    RTSC_MaxDepth      - (UWORD)
  1556. '                         The maximum display depth allowed.
  1557. '    RTSC_PropertyFlags - (ULONG)
  1558. '                         A mode must have these property flags to be
  1559. '                         included.  Only bits set in RTSC_PropertyMask are
  1560. '                         considered.
  1561. '    RTSC_PropertyMask  - (ULONG)
  1562. '                         Mask to apply to RTSC_PropertyFlags to determine
  1563. '                         which bits to consider.  See use of 'newsignals' and
  1564. '                         'signalmask' in exec.library/SetSignal().  Default
  1565. '                         is to consider all bits in RTSC_PropertyFlags as
  1566. '                         significant.
  1567. '    RTSC_FilterFunc    - (struct Hook *)
  1568. '                         Call this hook for each display mode id in the
  1569. '                         system's list.
  1570. '                         Parameters are as follows:
  1571. '                           A0 - (struct Hook *) your hook
  1572. '                           A2 - (struct rtScreenModeRequester *) your req
  1573. '                           A1 - (ULONG) 32-bit extended mode id
  1574. '                         If your hook returns TRUE the mode will be accepted.
  1575. '                         If it returns FALSE the mode will be skipped and
  1576. '                         will not appear in the requester.
  1577. '
  1578. '  RESULT
  1579. '    ret - FALSE if the requester was canceled or TRUE if the user selected a
  1580. '          screen mode (check 'smreq->DisplayID' for the 32-bit extended
  1581. '          display mode, 'smreq->DisplayWidth' and 'smreq->DisplayHeight' for
  1582. '          the display size, 'smreq->DisplayDepth' for the screen's depth) or
  1583. '          FALSE if the requester was canceled.
  1584. '
  1585. '  NOTE
  1586. '    Automatically adjusts the requester to the screen font.
  1587. '    If the screen font is proportional the default font will be used.
  1588. '
  1589. '    If the requester got too big for the screen because of a very large font,
  1590. '    the topaz.font will be used.
  1591. '
  1592. '    rtScreenModeRequest() checks the pr_WindowPtr of your process to find the
  1593. '    screen to put the requester on.
  1594. '
  1595. '  BUGS
  1596. '    none known
  1597. '
  1598. '  SEE ALSO
  1599. '    graphics/GetDisplayInfoData() graphics/displayinfo.h
  1600. '    exec.library/SetSignal()
  1601. '    Intuition/SA_DisplayID screen tag
  1602. '
  1603. '
  1604. DECLARE SUB rtScreenToFrontSafely LIBRARY
  1605. '
  1606. '    rtScreenToFrontSafely (screen); 
  1607. '
  1608. '    void rtScreenToFrontSafely (struct Screen *);
  1609. '                                A0
  1610. '
  1611. '  DESCRIPTION
  1612. '    Brings the specified screen to the front of the display, but only after
  1613. '    checking it is still in the list of currently open screens.
  1614. '
  1615. '    This function can be used to bring a screen back to the front of the
  1616. '    display after bringing another screen to the front.  If the first screen
  1617. '    closed while you where busy it is harmless to call this function, unlike
  1618. '    calling the normal ScreenToFront().
  1619. '
  1620. '  INPUTS
  1621. '    screen - pointer to the screen.
  1622. '
  1623. '  RESULT
  1624. '    none
  1625. '
  1626. '  NOTE
  1627. '    This function is for the advanced ReqTools user.
  1628. '
  1629. '  BUGS
  1630. '    none known
  1631. '
  1632. '  SEE ALSO
  1633. '    intuition.library/ScreenToFront()
  1634. '
  1635. '
  1636. DECLARE SUB rtSetReqPosition LIBRARY
  1637. '
  1638. '    rtSetReqPosition (reqpos, newwindow, screen, window);
  1639. '
  1640. '    void rtSetReqPosition
  1641. '               (ULONG, struct NewWindow *, struct Screen *, struct Window *);
  1642. '                D0     A0                  A1               A2
  1643. '
  1644. '  DESCRIPTION
  1645. '    Sets newwindow->LeftEdge and newwindow->TopEdge according to reqpos.
  1646. '
  1647. '    Except for the left- and topedge 'newwindow' must already be completely
  1648. '    initialized.
  1649. '
  1650. '    The newwindow->LeftEdge and newwindow->TopEdge already in the NewWindow
  1651. '    structure will be used as offsets to the requested position.  If you'd
  1652. '    like a window at position (25,18) from the top left of the screen you
  1653. '    would fill newwindow->LeftEdge with 25, newwindow->TopEdge with 18 and
  1654. '    call rtSetReqPosition() with reqpos equal to REQPOS_TOPLEFTSCR.
  1655. '
  1656. '    Don't forget to make sure newwindow->LeftEdge and newwindow->TopEdge
  1657. '    are 0 if you don't want to offset your window.
  1658. '
  1659. '    In case of REQPOS_POINTER you can use them to point to your window's
  1660. '    hotspot, where the pointer should point.  If you call rtSetReqPosition()
  1661. '    with the left- and topedge equal to 0 you'd get a window appearing with
  1662. '    its top- and leftedge equal to the current pointer position.
  1663. '
  1664. '    Note that the screen pointer may _NOT_ be NULL.  If you have your own
  1665. '    window open you can supply yourwindow->WScreen to this function.
  1666. '
  1667. '    The window pointer is only required if reqpos is REQPOS_CENTERWIN or
  1668. '    REQPOS_TOPLEFTWIN.  Even in this case you may call rtSetReqPosition()
  1669. '    with a NULL window pointer.  The positions will simply fall back to
  1670. '    REQPOS_CENTERSCR and REQPOS_TOPLEFTSCR respectively.
  1671. '
  1672. '  INPUTS
  1673. '    reqpos    - one of the REQPOS_... constants usable with RT_ReqPos.
  1674. '    newwindow - pointer to your (already initialized) NewWindow structure.
  1675. '    screen    - pointer to screen the requester will appear on.
  1676. '    window    - pointer to parent window or NULL.
  1677. '
  1678. '  RESULT
  1679. '    none
  1680. '
  1681. '  NOTE
  1682. '    This function is for the advanced ReqTools user.
  1683. '
  1684. '  BUGS
  1685. '    none known
  1686. '
  1687. '  SEE ALSO
  1688. '    RT_ReqPos tag
  1689. '
  1690. '
  1691. DECLARE SUB rtSetWaitPointer LIBRARY
  1692. '
  1693. '    rtSetWaitPointer (window);
  1694. '
  1695. '    void rtSetWaitPointer (struct Window *);
  1696. '                           A0
  1697. '
  1698. '  DESCRIPTION
  1699. '    Change the window's pointer image to that of a wait pointer.  Call this
  1700. '    function whenever your program will be busy doing something for a lengthy
  1701. '    period of time.
  1702. '
  1703. '    It is recommended you call this function before calling any of the
  1704. '    requester functions.  This way if the user clicks in your window he will
  1705. '    know he must respond to the requester before doing anything else.  Also
  1706. '    see the RT_WaitPointer tag for an automatic way of setting the wait
  1707. '    pointer.  If you are using ReqTools V38+ check out the RT_LockWindow tag!
  1708. '
  1709. '  INPUTS
  1710. '    window - pointer to the window to receive the wait pointer.
  1711. '
  1712. '  RESULT
  1713. '    none
  1714. '
  1715. '  NOTE
  1716. '    The wait pointer will look exactly like the standard Workbench 2.0
  1717. '    wait pointer.  In combination with PointerX, ClockTick or LacePointer
  1718. '    the handle will turn.
  1719. '
  1720. '  BUGS
  1721. '    none known
  1722. '
  1723. '  SEE ALSO
  1724. '
  1725. '
  1726. DECLARE SUB rtSpread LIBRARY
  1727. '
  1728. '    rtSpread (posarray, sizearray, totalsize, min, max, num);
  1729. '
  1730. '    void rtSpread (ULONG *, ULONG *, ULONG, ULONG, ULONG, ULONG);
  1731. '                   A0       A1       D0     D1     D2     D3
  1732. '
  1733. '  DESCRIPTION
  1734. '    Evenly spread a number of objects over a certain length.
  1735. '    Primary use is for arrangement of gadgets in a window.
  1736. '
  1737. '    Example:
  1738. '
  1739. '    'sizearray' holds following values: 4, 6, 4, 2 and 8,
  1740. '    'totalsize' is 24 (= 4 + 6 + 4 + 2 + 8),
  1741. '    'min' is 3, 'max' is 43,
  1742. '    and finally, 'num' is 5.
  1743. '
  1744. '    After calling rtSpread() 'posarray' would hold the following
  1745. '    values: 3, 11, 19, 26 and 31.
  1746. '
  1747. '    My attempt at a visual representation:
  1748. '
  1749. '        |                                            |
  1750. '        |  |                                      |  |
  1751. '        |  OOOO    OOOOOO    OOOO    OO    OOOOOOOO  |
  1752. '        |  |                                      |  |
  1753. '        |         1    1    2    2    3    3    4    4
  1754. '        0----5----0----5----0----5----0----5----0----5
  1755. '
  1756. '  INPUTS
  1757. '    posarray  - pointer to array to be filled with positions.
  1758. '    sizearray - pointer to array of sizes.
  1759. '    totalsize - total size of all objects (sum of all values in sizearray).
  1760. '    min       - first position to use.
  1761. '    max       - last position, first _NOT_ to use.
  1762. '    num       - number of objects (size of posarray and sizearray).
  1763. '
  1764. '  RESULT
  1765. '    none
  1766. '
  1767. '  NOTE
  1768. '    This function is for the advanced ReqTools user.
  1769. '
  1770. '  BUGS
  1771. '    none known
  1772. '
  1773. '  SEE ALSO
  1774. '
  1775. '
  1776. DECLARE SUB rtUnlockWindow() LIBRARY '[V38]
  1777. '
  1778. '    rtUnlockWindow (window, windowlock);
  1779. '
  1780. '    void rtUnlockWindow (struct Window *, APTR);
  1781. '                         A0               A1
  1782. '
  1783. '  DESCRIPTION
  1784. '    Unlock a window previously locked with rtLockWindow().  The window will
  1785. '    once again accept user input and will get its original mouse pointer
  1786. '    back (default or custom).
  1787. '
  1788. '    Under Kickstart V39 the original window pointer will not be restored if
  1789. '    it was set using SetWindowPointer().  You will have to restore the
  1790. '    pointer yourself in this case.
  1791. '
  1792. '  INPUTS
  1793. '    window     - pointer to the window to be unlocked.
  1794. '    windowlock - the windowlock pointer returned by rtLockWindow(), may
  1795. '                 be NULL.
  1796. '
  1797. '  RESULT
  1798. '    none
  1799. '
  1800. '  BUGS
  1801. '    none known
  1802. '
  1803. '  SEE ALSO
  1804. '
  1805.